import com.golden.gamedev.object.Background;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import com.golden.gamedev.object.collision.CollisionBounds;
import com.golden.gamedev.object.collision.CollisionGroup;
import com.golden.gamedev.object.collision.CollisionRect;

public class WCollisionCheck extends CollisionBounds {
	public boolean collidedWall;

	public WCollisionCheck(Background bg) {

		super(bg);
		collidedWall = false;

	}

	public void collided(Sprite sprite) {
		collidedWall = true;
		
		if (isCollisionSide(BOTTOM_COLLISION)) {
			sprite.setVerticalSpeed(-sprite.getVerticalSpeed());
		

			sprite.setY(sprite.getY() + (-2));

		}
		if (isCollisionSide(TOP_COLLISION)) {
			sprite.setVerticalSpeed(-sprite.getVerticalSpeed());
			sprite.setY(sprite.getY() + (2));

		}
		if (isCollisionSide(LEFT_COLLISION)) {
			sprite.setHorizontalSpeed(-sprite.getHorizontalSpeed());
			sprite.setX(sprite.getX() + (2));

		}

		if (isCollisionSide(RIGHT_COLLISION)) {
			sprite.setHorizontalSpeed(-sprite.getHorizontalSpeed());
			sprite.setX(sprite.getX() - (2));

		}
	}

	public boolean collided() {
		return collidedWall;
	}

}
